package com.pethospital.entity;

import java.math.BigDecimal;
import java.sql.Date;
import java.sql.Timestamp;

/**
 * 健康记录实体类
 * Health Record Entity Class
 * 
 * @author PetHospital System
 * @version 1.0
 */
public class HealthRecord {
    
    private Integer recordId;           // 记录ID
    private Integer petId;              // 宠物ID
    private Date visitDate;             // 就诊日期
    private String symptoms;            // 症状
    private String diagnosis;           // 诊断结果
    private String treatment;           // 治疗方案
    private String medication;          // 用药记录
    private String doctorName;          // 医生姓名
    private Date nextVisitDate;         // 下次复诊日期
    private BigDecimal cost;            // 费用
    private String notes;               // 备注
    private Timestamp createTime;       // 创建时间
    private Timestamp updateTime;       // 更新时间
    
    // 关联对象
    private Pet pet;                    // 宠物信息

    /**
     * 默认构造函数
     */
    public HealthRecord() {
    }

    /**
     * 带参构造函数
     */
    public HealthRecord(Integer petId, Date visitDate, String symptoms, String diagnosis,
                       String treatment, String doctorName, BigDecimal cost) {
        this.petId = petId;
        this.visitDate = visitDate;
        this.symptoms = symptoms;
        this.diagnosis = diagnosis;
        this.treatment = treatment;
        this.doctorName = doctorName;
        this.cost = cost;
    }

    // Getter和Setter方法
    public Integer getRecordId() {
        return recordId;
    }

    public void setRecordId(Integer recordId) {
        this.recordId = recordId;
    }

    public Integer getPetId() {
        return petId;
    }

    public void setPetId(Integer petId) {
        this.petId = petId;
    }

    public Date getVisitDate() {
        return visitDate;
    }

    public void setVisitDate(Date visitDate) {
        this.visitDate = visitDate;
    }

    public String getSymptoms() {
        return symptoms;
    }

    public void setSymptoms(String symptoms) {
        this.symptoms = symptoms;
    }

    public String getDiagnosis() {
        return diagnosis;
    }

    public void setDiagnosis(String diagnosis) {
        this.diagnosis = diagnosis;
    }

    public String getTreatment() {
        return treatment;
    }

    public void setTreatment(String treatment) {
        this.treatment = treatment;
    }

    public String getMedication() {
        return medication;
    }

    public void setMedication(String medication) {
        this.medication = medication;
    }

    public String getDoctorName() {
        return doctorName;
    }

    public void setDoctorName(String doctorName) {
        this.doctorName = doctorName;
    }

    public Date getNextVisitDate() {
        return nextVisitDate;
    }

    public void setNextVisitDate(Date nextVisitDate) {
        this.nextVisitDate = nextVisitDate;
    }

    public BigDecimal getCost() {
        return cost;
    }

    public void setCost(BigDecimal cost) {
        this.cost = cost;
    }

    public String getNotes() {
        return notes;
    }

    public void setNotes(String notes) {
        this.notes = notes;
    }

    public Timestamp getCreateTime() {
        return createTime;
    }

    public void setCreateTime(Timestamp createTime) {
        this.createTime = createTime;
    }

    public Timestamp getUpdateTime() {
        return updateTime;
    }

    public void setUpdateTime(Timestamp updateTime) {
        this.updateTime = updateTime;
    }

    public Pet getPet() {
        return pet;
    }

    public void setPet(Pet pet) {
        this.pet = pet;
    }

    /**
     * 判断是否需要复诊
     */
    public boolean needsFollowUp() {
        if (nextVisitDate == null) return false;
        return nextVisitDate.after(new Date(System.currentTimeMillis()));
    }

    /**
     * 获取费用显示文本
     */
    public String getCostDisplay() {
        if (cost == null) return "0.00";
        return cost.toString();
    }

    @Override
    public String toString() {
        return "HealthRecord{" +
                "recordId=" + recordId +
                ", petId=" + petId +
                ", visitDate=" + visitDate +
                ", symptoms='" + symptoms + '\'' +
                ", diagnosis='" + diagnosis + '\'' +
                ", doctorName='" + doctorName + '\'' +
                ", cost=" + cost +
                ", createTime=" + createTime +
                '}';
    }
}
